home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / c / gettimeofday.man < prev    next >
Encoding:
Text File  |  1989-01-03  |  2.7 KB  |  133 lines

  1.  
  2.  
  3.  
  4. GETTIMEOFDAY          C Library Procedures           GETTIMEOFDAY
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      gettimeofday, settimeofday - get/set date and time
  10.  
  11. SSYYNNOOPPSSIISS
  12.      ##iinncclluuddee <<ssyyss//ttiimmee..hh>>
  13.  
  14.      ggeettttiimmeeooffddaayy((ttpp,, ttzzpp))
  15.      ssttrruucctt ttiimmeevvaall **ttpp;;
  16.      ssttrruucctt ttiimmeezzoonnee **ttzzpp;;
  17.  
  18.      sseettttiimmeeooffddaayy((ttpp,, ttzzpp))
  19.      ssttrruucctt ttiimmeevvaall **ttpp;;
  20.      ssttrruucctt ttiimmeezzoonnee **ttzzpp;;
  21.  
  22. DDEESSCCRRIIPPTTIIOONN
  23.      The system's notion of the current Greenwich time and the
  24.      current time zone is obtained with the _g_e_t_t_i_m_e_o_f_d_a_y call,
  25.      and set with the _s_e_t_t_i_m_e_o_f_d_a_y call.  The time is expressed
  26.      in seconds and microseconds since midnight (0 hour), January
  27.      1, 1970.  The resolution of the system clock is hardware
  28.      dependent, and the time may be updated continuously or in
  29.      ``ticks.''  If _t_p or _t_z_p is NULL, the associated time infor-
  30.      mation will not be returned or set.
  31.  
  32.      The structures pointed to by _t_p and _t_z_p are defined in
  33.      <_s_y_s/_t_i_m_e._h> as:
  34.  
  35.           struct timeval {
  36.                long tv_sec;        /* seconds since Jan. 1, 1970 */
  37.                long tv_usec;       /* and microseconds */
  38.           };
  39.  
  40.           struct timezone {
  41.                int  tz_minuteswest;     /* of Greenwich */
  42.                int  tz_dsttime;    /* type of dst correction to apply */
  43.           };
  44.  
  45.      The _t_i_m_e_z_o_n_e structure indicates the local time zone (meas-
  46.      ured in minutes of time westward from Greenwich), and a flag
  47.      that, if nonzero, indicates that Daylight Saving time
  48.      applies locally during the appropriate part of the year.
  49.  
  50.      Only the super-user may set the time of day or time zone.
  51.  
  52. RREETTUURRNN
  53.      A 0 return value indicates that the call succeeded.  A -1
  54.      return value indicates an error occurred, and in this case
  55.      an error code is stored into the global variable _e_r_r_n_o.
  56.  
  57. EERRRROORRSS
  58.      The following error codes may be set in _e_r_r_n_o:
  59.  
  60.  
  61.  
  62.  
  63. Sprite v1.0              April 11, 1987                         1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. GETTIMEOFDAY          C Library Procedures           GETTIMEOFDAY
  71.  
  72.  
  73.  
  74.      [EFAULT]       An argument address referenced invalid
  75.                     memory.
  76.  
  77.      [EPERM]        A user other than the super-user attempted to
  78.                     set the time.
  79.  
  80. SSEEEE AALLSSOO
  81.      date(1), adjtime(2), ctime(3), timed(8)
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Sprite v1.0              April 11, 1987                         2
  130.  
  131.  
  132.  
  133.